/******************************************************************************
** 
** One word in a line.
** 
** File name:	one_word_in_line.c
** Compilation:	cc one_word_in_line.c -o one_word_in_line
** Execution:	./one_word_in_line
** 
** Description:
** Reads the input and prints all the words in it each on its own line.
** 
******************************************************************************/
#include <stdio.h>

#define IN 1
#define OUT 0

int c, state;

main()
{
    state = 0;
    
    while ((c=getchar()) != EOF) {
      if (c == ' ' || c == '\t' || c == '\n') {
        if (state == IN) {
          putchar('\n');
        }
        state = OUT;
      } else {
        state = IN;
        putchar(c);
      }
    }
}

